<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>gdsl: gdsl_stack.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">gdsl
   &#160;<span id="projectnumber">1.7</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('gdsl__stack_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">gdsl_stack.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="gdsl__stack_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * This file is part of the Generic Data Structures Library (GDSL).</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 1998-2006 Nicolas Darnis &lt;ndarnis@free.fr&gt;.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * The GDSL library is free software; you can redistribute it and/or </span>
<a name="l00006"></a>00006 <span class="comment"> * modify it under the terms of the GNU General Public License as </span>
<a name="l00007"></a>00007 <span class="comment"> * published by the Free Software Foundation; either version 2 of</span>
<a name="l00008"></a>00008 <span class="comment"> * the License, or (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * The GDSL library is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00013"></a>00013 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment"> * along with the GDSL library; see the file COPYING.</span>
<a name="l00017"></a>00017 <span class="comment"> * If not, write to the Free Software Foundation, Inc., </span>
<a name="l00018"></a>00018 <span class="comment"> * 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA.</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> * $RCSfile: gdsl__stack_8h_source.html,v $</span>
<a name="l00021"></a>00021 <span class="comment"> * $Revision: 1.3 $</span>
<a name="l00022"></a>00022 <span class="comment"> * $Date: 2013/06/12 16:36:13 $</span>
<a name="l00023"></a>00023 <span class="comment"> */</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00026"></a>00026 <span class="preprocessor">#ifndef _GDSL_STACK_H_</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define _GDSL_STACK_H_</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#include &quot;<a class="code" href="gdsl__types_8h.html">gdsl_types.h</a>&quot;</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00036"></a>00036 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> 
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 
<a name="l00053"></a><a class="code" href="group__gdsl__stack.html#gaed560443d2612fcdb10a55a51687cbbb">00053</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>_gdsl_stack* <a class="code" href="group__gdsl__stack.html#gaed560443d2612fcdb10a55a51687cbbb" title="GDSL stack type.">gdsl_stack_t</a>;
<a name="l00054"></a>00054 
<a name="l00055"></a>00055 <span class="comment">/******************************************************************************/</span>
<a name="l00056"></a>00056 <span class="comment">/* Management functions of stacks                                             */</span>
<a name="l00057"></a>00057 <span class="comment">/******************************************************************************/</span>
<a name="l00058"></a>00058 
<a name="l00079"></a>00079 <span class="keyword">extern</span> gdsl_stack_t
<a name="l00080"></a>00080 <a class="code" href="group__gdsl__stack.html#ga226386196ca32ee4eae9441f9229a990" title="Create a new stack.">gdsl_stack_alloc</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* NAME,
<a name="l00081"></a>00081           <a class="code" href="group__gdsl__types.html#ga32a9b4e8b9665183c2741d28a5ced64f" title="GDSL Alloc element function type.">gdsl_alloc_func_t</a> ALLOC_F,
<a name="l00082"></a>00082           <a class="code" href="group__gdsl__types.html#ga2c6b3f96b291b5b39d2799f93e350053" title="GDSL Free element function type.">gdsl_free_func_t</a> FREE_F
<a name="l00083"></a>00083           );
<a name="l00084"></a>00084 
<a name="l00098"></a>00098 <span class="keyword">extern</span> <span class="keywordtype">void</span> 
<a name="l00099"></a>00099 <a class="code" href="group__gdsl__stack.html#gac115f451db17f6509048018bdef1ffe6" title="Destroy a stack.">gdsl_stack_free</a> (gdsl_stack_t S
<a name="l00100"></a>00100          );
<a name="l00101"></a>00101 
<a name="l00115"></a>00115 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00116"></a>00116 <a class="code" href="group__gdsl__stack.html#ga2ad434c6a6cd2e66033195a9cee5919f" title="Flush a stack.">gdsl_stack_flush</a> (gdsl_stack_t S
<a name="l00117"></a>00117           );
<a name="l00118"></a>00118 
<a name="l00119"></a>00119 <span class="comment">/******************************************************************************/</span>
<a name="l00120"></a>00120 <span class="comment">/* Consultation functions of stacks                                           */</span>
<a name="l00121"></a>00121 <span class="comment">/******************************************************************************/</span>
<a name="l00122"></a>00122 
<a name="l00132"></a>00132 <span class="keyword">extern</span> <span class="keyword">const</span> <span class="keywordtype">char</span>*
<a name="l00133"></a>00133 <a class="code" href="group__gdsl__stack.html#gaf8e7609d8785a3c5f458b996aa42baef" title="Getsthe name of a stack.">gdsl_stack_get_name</a> (<span class="keyword">const</span> gdsl_stack_t S
<a name="l00134"></a>00134              );
<a name="l00135"></a>00135 
<a name="l00143"></a>00143 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>
<a name="l00144"></a>00144 <a class="code" href="group__gdsl__stack.html#ga240a364616309e15eb374469af80a019" title="Get the size of a stack.">gdsl_stack_get_size</a> (<span class="keyword">const</span> gdsl_stack_t S
<a name="l00145"></a>00145              );
<a name="l00146"></a>00146 
<a name="l00164"></a>00164 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a>
<a name="l00165"></a>00165 <a class="code" href="group__gdsl__stack.html#ga89fc03e3da09672b366c6e3f1dd3bb4c" title="Get the growing factor of a stack.">gdsl_stack_get_growing_factor</a> (<span class="keyword">const</span> gdsl_stack_t S
<a name="l00166"></a>00166                    );
<a name="l00167"></a>00167 
<a name="l00176"></a>00176 <span class="keyword">extern</span> <span class="keywordtype">bool</span> 
<a name="l00177"></a>00177 <a class="code" href="group__gdsl__stack.html#ga05718ea5cff27449f3f63e2d7bdbea3b" title="Check if a stack is empty.">gdsl_stack_is_empty</a> (<span class="keyword">const</span> gdsl_stack_t S
<a name="l00178"></a>00178              );
<a name="l00179"></a>00179 
<a name="l00190"></a>00190 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00191"></a>00191 <a class="code" href="group__gdsl__stack.html#gaa8464560e005bf2cb91fa12055359b95" title="Get the top of a stack.">gdsl_stack_get_top</a> (<span class="keyword">const</span> gdsl_stack_t S
<a name="l00192"></a>00192             );
<a name="l00193"></a>00193 
<a name="l00204"></a>00204 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00205"></a>00205 <a class="code" href="group__gdsl__stack.html#ga09b1e39af6f153586bcd44be16678fd8" title="Get the bottom of a stack.">gdsl_stack_get_bottom</a> (<span class="keyword">const</span> gdsl_stack_t S
<a name="l00206"></a>00206                );
<a name="l00207"></a>00207 
<a name="l00208"></a>00208 <span class="comment">/******************************************************************************/</span>
<a name="l00209"></a>00209 <span class="comment">/* Modification functions of stacks                                           */</span>
<a name="l00210"></a>00210 <span class="comment">/******************************************************************************/</span>
<a name="l00211"></a>00211 
<a name="l00225"></a>00225 <span class="keyword">extern</span> gdsl_stack_t
<a name="l00226"></a>00226 <a class="code" href="group__gdsl__stack.html#gac1ae848edf02e7e2ce06ce0f0b84c249" title="Set the name of a stack.">gdsl_stack_set_name</a> (gdsl_stack_t S,
<a name="l00227"></a>00227              <span class="keyword">const</span> <span class="keywordtype">char</span>* NEW_NAME
<a name="l00228"></a>00228              );
<a name="l00229"></a>00229 
<a name="l00248"></a>00248 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00249"></a>00249 <a class="code" href="group__gdsl__stack.html#gab913e793c095b977856a3367a58ea161" title="Set the growing factor of a stack.">gdsl_stack_set_growing_factor</a> (gdsl_stack_t S,
<a name="l00250"></a>00250                    <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a> G
<a name="l00251"></a>00251                    );
<a name="l00252"></a>00252 
<a name="l00272"></a>00272 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00273"></a>00273 <a class="code" href="group__gdsl__stack.html#gac3566b143b4e3129719840660c9824b3" title="Insert an element in a stack (PUSH).">gdsl_stack_insert</a> (gdsl_stack_t S,
<a name="l00274"></a>00274            <span class="keywordtype">void</span>* VALUE
<a name="l00275"></a>00275            );
<a name="l00276"></a>00276 
<a name="l00289"></a>00289 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00290"></a>00290 <a class="code" href="group__gdsl__stack.html#gaab5fda5eded58afa96fe179937697940" title="Remove an element from a stack (POP).">gdsl_stack_remove</a> (gdsl_stack_t S
<a name="l00291"></a>00291            );
<a name="l00292"></a>00292 
<a name="l00293"></a>00293 <span class="comment">/******************************************************************************/</span>
<a name="l00294"></a>00294 <span class="comment">/* Search functions of stacks                                                 */</span>
<a name="l00295"></a>00295 <span class="comment">/******************************************************************************/</span>
<a name="l00296"></a>00296 
<a name="l00312"></a>00312 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00313"></a>00313 <a class="code" href="group__gdsl__stack.html#gaabe9364e7e4d4df0ec2c43a9c94f17bd" title="Search for a particular element in a stack.">gdsl_stack_search</a> (<span class="keyword">const</span> gdsl_stack_t S,
<a name="l00314"></a>00314            <a class="code" href="group__gdsl__types.html#ga200177a9a1ac3f2363e228b0e5faeda7" title="GDSL Comparison element function type.">gdsl_compare_func_t</a> COMP_F,
<a name="l00315"></a>00315            <span class="keywordtype">void</span>* VALUE
<a name="l00316"></a>00316            );
<a name="l00317"></a>00317 
<a name="l00328"></a>00328 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00329"></a>00329 <a class="code" href="group__gdsl__stack.html#ga025af567070bbc933a380c4efcf8a529" title="Search for an element by its position in a stack.">gdsl_stack_search_by_position</a> (<span class="keyword">const</span> gdsl_stack_t S,
<a name="l00330"></a>00330                    <a class="code" href="group__gdsl__types.html#ga9c34ac44da309b004570530c8cec8a0e">ulong</a> POS
<a name="l00331"></a>00331                    );
<a name="l00332"></a>00332 
<a name="l00333"></a>00333 <span class="comment">/******************************************************************************/</span>
<a name="l00334"></a>00334 <span class="comment">/* Parse functions of stacks                                                  */</span>
<a name="l00335"></a>00335 <span class="comment">/******************************************************************************/</span>
<a name="l00336"></a>00336 
<a name="l00354"></a>00354 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00355"></a>00355 <a class="code" href="group__gdsl__stack.html#ga09c4e7d90846c987e009070395db9519" title="Parse a stack from bottom to top.">gdsl_stack_map_forward</a> (<span class="keyword">const</span> gdsl_stack_t S,
<a name="l00356"></a>00356             <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00357"></a>00357             <span class="keywordtype">void</span>* USER_DATA
<a name="l00358"></a>00358             );
<a name="l00359"></a>00359 
<a name="l00377"></a>00377 <span class="keyword">extern</span> <a class="code" href="group__gdsl__types.html#ga0e2b9d7fb5ca9e6d50100e5d9e4bcae7" title="GDSL element type.">gdsl_element_t</a>
<a name="l00378"></a>00378 <a class="code" href="group__gdsl__stack.html#gaaec1bfd42894b1d163a59f3a06194c93" title="Parse a stack from top to bottom.">gdsl_stack_map_backward</a> (<span class="keyword">const</span> gdsl_stack_t S,
<a name="l00379"></a>00379              <a class="code" href="group__gdsl__types.html#ga2500bfaaec5df890e72b43f448f13ee8" title="GDSL Map element function type.">gdsl_map_func_t</a> MAP_F,
<a name="l00380"></a>00380              <span class="keywordtype">void</span>* USER_DATA
<a name="l00381"></a>00381              );
<a name="l00382"></a>00382 
<a name="l00383"></a>00383 <span class="comment">/******************************************************************************/</span>
<a name="l00384"></a>00384 <span class="comment">/* Input/output functions of stacks                                           */</span> 
<a name="l00385"></a>00385 <span class="comment">/******************************************************************************/</span>
<a name="l00386"></a>00386 
<a name="l00402"></a>00402 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00403"></a>00403 <a class="code" href="group__gdsl__stack.html#ga5862ed3924559830be65c7e6b364d217" title="Write all the elements of a stack to a file.">gdsl_stack_write</a> (<span class="keyword">const</span> gdsl_stack_t S,
<a name="l00404"></a>00404           <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00405"></a>00405           FILE* OUTPUT_FILE,
<a name="l00406"></a>00406           <span class="keywordtype">void</span>* USER_DATA
<a name="l00407"></a>00407           );
<a name="l00408"></a>00408 
<a name="l00425"></a>00425 <span class="keyword">extern</span> <span class="keywordtype">void</span>
<a name="l00426"></a>00426 <a class="code" href="group__gdsl__stack.html#gace0385f078efc764f4da7bf68b71942a" title="Write the content of a stack to a file into XML.">gdsl_stack_write_xml</a> (gdsl_stack_t S,
<a name="l00427"></a>00427               <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00428"></a>00428               FILE* OUTPUT_FILE,
<a name="l00429"></a>00429               <span class="keywordtype">void</span>* USER_DATA
<a name="l00430"></a>00430               );
<a name="l00431"></a>00431 
<a name="l00448"></a>00448 <span class="keyword">extern</span> <span class="keywordtype">void</span> 
<a name="l00449"></a>00449 <a class="code" href="group__gdsl__stack.html#gacdd3cfc7a7060ecc8278be39a7a79219" title="Dump the internal structure of a stack to a file.">gdsl_stack_dump</a> (gdsl_stack_t S,
<a name="l00450"></a>00450          <a class="code" href="group__gdsl__types.html#gafc7394b6c8e0a5bd92df75e24512dfd6" title="GDSL Write element function type.">gdsl_write_func_t</a> WRITE_F,
<a name="l00451"></a>00451          FILE* OUTPUT_FILE,
<a name="l00452"></a>00452          <span class="keywordtype">void</span>* USER_DATA
<a name="l00453"></a>00453          );
<a name="l00454"></a>00454 
<a name="l00455"></a>00455 
<a name="l00456"></a>00456 <span class="comment">/*</span>
<a name="l00457"></a>00457 <span class="comment"> * @}</span>
<a name="l00458"></a>00458 <span class="comment"> */</span>
<a name="l00459"></a>00459 
<a name="l00460"></a>00460 
<a name="l00461"></a>00461 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00462"></a>00462 <span class="preprocessor"></span>}
<a name="l00463"></a>00463 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00464"></a>00464 
<a name="l00465"></a>00465 
<a name="l00466"></a>00466 <span class="preprocessor">#endif </span><span class="comment">/* _GDSL_STACK_H_ */</span>
<a name="l00467"></a>00467 
<a name="l00468"></a>00468 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="gdsl__stack_8h.html">gdsl_stack.h</a>      </li>

    <li class="footer">Generated on Wed Jun 12 2013 18:18:47 for gdsl by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
